package com.erp.erp_servers.money.imp;

import com.erp.erp_dao.money.IPaymentDetailDao;
import com.erp.erp_entitys.money.entity.PaymentDetailEntity;
import com.erp.erp_entitys.money.req.PaymentShipmentAmountStatisticsReq;
import com.erp.erp_entitys.money.req.PaymentStatistics1Req;
import com.erp.erp_entitys.money.req.purchasePaymentStatisticsReq;
import com.erp.erp_entitys.money.rsp.PaymentShipmentAmountStatisticsRsp;
import com.erp.erp_entitys.money.rsp.PaymentStatistics1Rsp;
import com.erp.erp_entitys.money.rsp.purchasePaymentStatisticsRes;
import com.erp.erp_servers.money.IPaymentDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : PaymentDetailServiceImp
 * @Description : 资金管理-付款明细实现类
 * @Author : lst
 * @Date: 2020-12-28 16:24
 */
@Service
public class PaymentDetailServiceImp implements IPaymentDetailService {

    /**
     * 注入付款明细mapper
     */
    private final IPaymentDetailDao paymentDetailDao;

    @Autowired
    public PaymentDetailServiceImp(IPaymentDetailDao paymentDetailDao) {
        this.paymentDetailDao = paymentDetailDao;
    }


    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public PaymentDetailEntity queryById(Integer id) {
        return paymentDetailDao.queryById(id);
    }


    /**
     * 通过实体作为筛选条件查询
     *
     * @param paymentDetail 实例对象
     * @return 对象列表
     */
    @Override
    public List<PaymentDetailEntity> queryAll(PaymentDetailEntity paymentDetail) {
        return paymentDetailDao.queryAll(paymentDetail);
    }


    /**
     * 新增数据
     *
     * @param paymentDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(PaymentDetailEntity paymentDetail) {
        return paymentDetailDao.insert(paymentDetail);
    }


    /**
     * 详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<PaymentDetailEntity> list) {
        return paymentDetailDao.addList(list);
    }


    /**
     * 修改数据
     *
     * @param paymentDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int update(PaymentDetailEntity paymentDetail) {
        return paymentDetailDao.update(paymentDetail);
    }

    @Override
    public List<PaymentStatistics1Rsp> paymentStatistics1List(PaymentStatistics1Req req) {
        return paymentDetailDao.paymentStatistics1List(req);
    }

    /**
     * 采购预付款统计
     * @param req 实例对象
     * @return 采购预付款统计
     */
    @Override
    public List<PaymentStatistics1Rsp> getStatisticsPurchasePrepayments(PaymentStatistics1Req req) {
        return paymentDetailDao.getStatisticsPurchasePrepayments(req);
    }

    @Override
    public List<PaymentShipmentAmountStatisticsRsp> paymentShipmentAmountList(PaymentShipmentAmountStatisticsReq req) {
        return paymentDetailDao.paymentShipmentAmountList(req);
    }

    @Override
    public List<purchasePaymentStatisticsRes> purchasePaymentStatisticsResList(purchasePaymentStatisticsReq req) {
        return paymentDetailDao.purchasePaymentStatisticsResList(req);
    }
}
